/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.mallsite.modules.shop.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品规格Entity
 * @author ruyang
 * @version 2020-12-04
 */
@Table(name="ms_goods_spec", alias="a", columns={
		@Column(name="spec_id", attrName="specId", label="类型编码", isPK=true),
		@Column(name="spec_name", attrName="specName", label="商品id", queryType=QueryType.LIKE),
		@Column(name="type_id", attrName="typeId", label="属性id"),
		@Column(name="spec_type", attrName="specType", label="0文字，1颜色，3图片"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class GoodsSpec extends DataEntity<GoodsSpec> {
	
	private static final long serialVersionUID = 1L;
	private String specId;		// 类型编码
	private String specName;		// 商品id
	private String typeId;		// 属性id
	private String specType;		// 0文字，1颜色，3图片
	
	public GoodsSpec() {
		this(null);
	}

	public GoodsSpec(String id){
		super(id);
	}
	
	public String getSpecId() {
		return specId;
	}

	public void setSpecId(String specId) {
		this.specId = specId;
	}
	
	@NotBlank(message="商品id不能为空")
	@Length(min=0, max=128, message="商品id长度不能超过 128 个字符")
	public String getSpecName() {
		return specName;
	}

	public void setSpecName(String specName) {
		this.specName = specName;
	}
	
	@NotBlank(message="属性id不能为空")
	@Length(min=0, max=128, message="属性id长度不能超过 128 个字符")
	public String getTypeId() {
		return typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}
	
	@NotBlank(message="0文字，1颜色，3图片不能为空")
	@Length(min=0, max=128, message="0文字，1颜色，3图片长度不能超过 128 个字符")
	public String getSpecType() {
		return specType;
	}

	public void setSpecType(String specType) {
		this.specType = specType;
	}
	
}